From 26f9a3f7f57a91259580387681935731ebb4a6ec Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 30 Jan 2008 15:19:22 +0000 Subject: [PATCH] ioemu: Fix xenstore access changes. Signed-off-by: Keir Fraser --- tools/ioemu/xenstore.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tools/ioemu/xenstore.c b/tools/ioemu/xenstore.c index 2905c79459..9d33237cb3 100644 --- a/tools/ioemu/xenstore.c +++ b/tools/ioemu/xenstore.c @@ -446,20 +446,15 @@ void xenstore_process_event(void *opaque) /* Strip off blktap sub-type prefix */ bpath = strdup(vec[XS_WATCH_PATH]); - if (bpath) + if (bpath == NULL) goto out; if ((offset = strrchr(bpath, '/')) != NULL) *offset = '\0'; if (pasprintf(&buf, "%s/type", bpath) == -1) goto out; drv = xs_read(xsh, XBT_NULL, buf, &len); - if (drv) { - if (!strcmp(drv, "tap")) { - offset = strchr(image, ':'); - if (offset) - memmove(image, offset+1, strlen(offset+1)+1 ); - } - } + if (drv && !strcmp(drv, "tap") && ((offset = strchr(image, ':')) != NULL)) + memmove(image, offset+1, strlen(offset+1)+1); if (!strcmp(image, bs_table[hd_index]->filename)) goto out; /* identical */ -- 2.30.2